package cn.datax.service.workflow.controller;

import cn.datax.common.base.BaseController;
import cn.datax.common.core.DataConstant;
import cn.datax.common.core.JsonPage;
import cn.datax.common.core.R;
import cn.datax.service.workflow.api.dto.ProcessInstanceCreateRequest;
import cn.datax.service.workflow.api.entity.BusinessFlowEntity;
import cn.datax.service.workflow.api.entity.CategoryEntity;
import cn.datax.service.workflow.api.query.FlowDefinitionQuery;
import cn.datax.service.workflow.api.query.FlowInstanceQuery;
import cn.datax.service.workflow.api.vo.BusinessFlowVo;
import cn.datax.service.workflow.api.vo.CategoryVo;
import cn.datax.service.workflow.api.vo.FlowHistInstanceVo;
import cn.datax.service.workflow.api.vo.FlowInstanceVo;
import cn.datax.service.workflow.mapstruct.BusinessFlowMapper;
import cn.datax.service.workflow.service.BusinessFlowStaticsService;
import cn.datax.service.workflow.service.FlowInstanceService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
import java.util.stream.Collectors;

@Api(tags = {"业务流程统计"})
@RestController
@RequestMapping("/FlowStatistics")
public class BusinessFlowStatisticsController extends BaseController {

    @Autowired
    private BusinessFlowStaticsService staticsService;

    @Autowired
    private BusinessFlowMapper staticsMapper;



    @ApiOperation(value = "获取API发布审批数据列表", notes = "")
    @GetMapping("/listApiPublish")
    public R getApiPublishList(BusinessFlowEntity flowDefinitionQuery) {
        List<BusinessFlowEntity> list = staticsService.getApiPublishStatics(flowDefinitionQuery.getBeginTime(),flowDefinitionQuery.getEndTime());
        return R.ok().setData(list);
    }
}
